/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.ejb.clients;

import cassys.application.DTOs.AssessmentDTO;
import cassys.application.DTOs.AssessmentGroupDTO;
import cassys.application.services.AssessmentManagementBeanRemote;
import cassys.application.services.ModuleManagementBeanRemote;
import cassys.domain.assessment.Assessment;
import cassys.domain.assessment.AssessmentGroup;
import cassys.domain.classManagement.Module;
import cassys.domain.classManagement.Student;
import java.util.List;

/**
 *
 * @author User
 */
public class AssessmentManagementDelegate {

    private AssessmentManagementBeanRemote assessmentManagementBean = null;

    public AssessmentManagementDelegate() {
        try {
            assessmentManagementBean = ServiceLocator.getInstance().lookupAssessmentManagementBean();
        } catch (Exception e) {
            System.out.println(e.getStackTrace());
        }
    }

    public void crateAssessment(Assessment assessment) {
        System.out.println(assessment.toString());
        assessmentManagementBean.createAssessment(assessment);
    }

    public List<Assessment> getAllAssessments() {
        return assessmentManagementBean.getAllAssessments();
    }

    public Assessment findByAssessmentId(long assessmentId) {
        return assessmentManagementBean.findByAssessmentId(assessmentId);
    }

    public AssessmentGroup findAssessmentGroupById(long assessmentGroupId) {
        return assessmentManagementBean.findAssessmentGroupById(assessmentGroupId);
    }

    public void updateAssessment(Assessment assessment) {
        assessmentManagementBean.updateAssessment(assessment);
    }

    public List<Student> getUngroupedStudent(long assessmentId) {
        return assessmentManagementBean.getAllUnGroupParticipent(assessmentId);
    }

    public void createGroupAssessment(AssessmentGroupDTO groupDTO) {
        assessmentManagementBean.createAssessmentGroup(groupDTO);
    }

    public void editAssessmentGroup(AssessmentGroupDTO groupDTO) {
        assessmentManagementBean.editAssessmentGroup(groupDTO);
    }

    public void deleteAssessmentGroup(AssessmentGroupDTO groupDTO) {
        assessmentManagementBean.deleteAssessmentGroup(groupDTO);
    }

    public List<AssessmentGroup> getAllAssessmentGroup(long assessmentId) {
        return assessmentManagementBean.getAllAssessmentGroup(assessmentId);
    }
}
